test(language/lint): add unit tests for empty-block pass#48
Merged
Conversation
Adds 5 unit tests for the empty-block lint pass in packages/language/src/lint/empty-block.ts, which flags `inputs:` or `outputs:` blocks that have no entries. Coverage: - Bare `inputs:` and `outputs:` (null-ish value) → flagged - Populated blocks → not flagged - Both blocks empty → two diagnostics - Multiple actions → one diagnostic per affected action Follows the same test pattern as required-fields.test.ts (salesforce#38). All tests pass via: pnpm --filter @agentscript/language test empty-block
awli
approved these changes
Jun 10, 2026
awli
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the contribution!
This was referenced Jun 11, 2026
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds 5 unit tests for the
empty-blocklint pass inpackages/language/src/lint/empty-block.ts. Brings the rule's test count from 0 to 5.Why
The
empty-blockrule flags emptyinputs:andoutputs:blocks (a common authoring mistake) but had no tests pinning down its behavior. This change closes the gap using the same pattern PR #38 (required-fields.test.ts) established for lint-rule tests.How
New test file at
packages/language/src/lint/empty-block.test.tsusing vitest. Followsrequired-fields.test.tsexactly: singledescribeblock, flatitcases, sharedgetDiagnosticshelper,ActionsBlock-based test schema.The 5 cases:
inputs:with no entriesinputs:blockoutputs:with no entriesinputs:andoutputs:are emptyTest Plan
Result:
pnpm --filter @agentscript/language test empty-block— 5/5 passingnpx eslint --config eslint.config.js packages/language/src/lint/empty-block.test.ts— exit 0Checklist